<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ketangzuoye</title>
  </head>
  <body>

    <script type="text/javascript">
    console.log("========== eaval  ==============");
    var str = " var a =1";
    eaval (str);



    console.log(a); console.log("========== Object对象 ===========");
    var str1 = {a : 1}
    var o =new Object(str1);
     console.log(o);




     console.log("=========== 部署 在Objec对象本身 ============");
     Objec.print = function (o)
     { console.log(o);
     }
     var o = new Objec();
      Objec.print(o);



       console.log("=========== 部署在Obje.prototype对象===========");
        Object.prototype.print = function ()
        { console.log(this);
        }
        var o2 = new Object();
        o2.print();


        console.log("================= Object.keys方法和Object.getOwnPropertyNames方法很相似 =============");
        var a3 = {a : 1,b:2};
        Object.keys(a3);
        Object.getOwnPropertyNames(a3);



         console.log("============== Object.keys ===============");
         console.log(Object.keys(a3));


          console.log("=================== Object.getOwnPropertyNames ==============");
          console.log(Object.getOwnPropertyNames(a3));


          console.log("=============== 涉及不可枚举情况下 ==============");
          var a4 = ['hello','world']; 

          console.log("================== Object.keys ================" );
          console.log(Object.keys(a4));

          console.log("============== Object.getOwnPropertyNames ======================" );
           console.log( Object.getOwnPropertyNames(a4));


           console.log("============= Object.prototype.valueOf() ===================" );
           var a5 = new Object();
           a5.valueOf === a5.valueOf() === a5;
            console.log(a6);


            console.log("================ Object.prototype.toString() ==============" );
            var a7 = new Object();var a8 = a7.toString();
            console.log(a8);

            console.log("============== Array.isArray() ============" );
            var a9 = [1,2,3];var a10 = Array.isArray();
             console.log(a10);


              console.log("=============== push() ===============" );
             var a11 = ["1"]var a12 = a11.push("string");var a13 = a11.pop();
             console.log(a12);
              console.log(a13);



              console.log("================ join() ==================");
             var a14 = [1,2,3];
             var a15 = a14.join("-");
              console.log(a15);


              console.log("============== concat() ============");
              var a16 = a14.concat([4]); console.log(a16);


               console.log("================ shift() =======================");
               var a17 = a14.shift(); console.log(a17);
               console.log(a14);


                console.log("=============== unshift() ==================");
                var a18 = a14.unshift('y');
                 console.log(a18);
                 console.log(a14);


                 console.log("============  reverse() ============");
                 var a19 = a14.reverse();
                  console.log(a19);



                  console.log("================ slice() ==============");
                  var a20 = a14.slice(2);
                   console.log(a20);
                   console.log(a14);


                   console.log("============= splice() =============");
                   var a21 = a14.splice(2);
                   console.log(a21);
                    console.log(a14);



                    console.log("================ sort() ================");
                    var a22 = [4,2,3,1];
                    var a23 = a22.sort();
                     console.log(a23);
                      console.log(a22);




                      console.log("=========== map() ============");
                      var a24 = a22.map(function (n) { console.log("n======"+n);
                      return n+1;
                    }
                    console.log(a24);



                      console.log("================ foreach ==============");
                      function log(a,b,c){ console.log('[' + b + '] = ' + a);
                    }



                    [2,5,9].forEach(log);


                    console.log("=========== filter() ===========");
                    var a25 = a22.filter(function (n){return (n>2)});
                     console.log(a25);
  </body>
</html>
